<template>
  <div class="caocao">
    <h1>我是 曹孟德</h1>
    <h2>当前生命值：{{ lifeNum }}</h2>
  </div>
</template>

<script>
export default {
    data(){
        return {
            lifeNum: 100
        }
    },
    mounted(){
        this.$eventBus.$on("getAttackFromLiubei",(num)=>{
            this.lifeNum -= num;
        })
    },
    created(){
        console.log(this);
    }
}
</script>

<style>

</style>